import TempalteCode.IAggregate;
import TempalteCode.IIterator;
import TempalteCode.ConcreteIterator;
import TempalteCode.ConcreteAggregate;

public class Main {
    public static void main(String[] args) {
        IAggregate aggregate = new ConcreteAggregate();
        IIterator iterator = aggregate.createIterator();
        iterator.addObject("村上春树");
        iterator.addObject("石黑一雄");
        iterator.addObject("三岛由纪夫");
        iterator.addObject("双雪涛");
        iterator.addObject("阿城");

        while (iterator.hasNext()){
            System.out.println(iterator.currentItme().toString());
            iterator.moveNext();
        }
    }
}